ns('J3D.Testcase').F = 
  (function() {
     var f = J3D.F;
     var m = J3D.Testcase.Main;
     var testFoldr = function() {
       var input = [
         {
           f: function(x) {
             return function(y) {
               return x * y;
             };
           }, 
           n: 1,
           data: (f.list(2, 3, 4, 5))
         },
         {
           f: function(x) {
             return function(y) {
               return x + y;
             };
           }, 
           n: 0,
           data: (f.list(2, 3, 4, 5))
         },
         {
           f: function(x) {
             return function(y) {
               return y + x;
             };
           }, 
           n: '',
           data: (f.list('a', 'b', 'c'))
         }
       ];
       
       var output = [
         120,
         14,
         'cba'
       ];
       
       return m.test(function(val) {
         return f.foldr(val.f)(val.n)(val.data);
       }, input, output);
     };
     
     var testMap = function() {
       var input = [
         {
           f: function(x) {
             return 2 * x;
           }, 
           data: (f.list(2, 3, 4, 5))
         },
         {
           f: function(x) {
             return x * x;
           }, 
           data: (f.list(2, 3, 4, 5))
         },
         {
           f: function(x) {
             return 'hello_' + x;
           }, 
           data: (f.list('a', 'b', 'c'))
         }
       ];
       
       var output = [
         f.list(4, 6, 8, 10),
         f.list(4, 9, 16, 25),
         f.list('hello_a', 'hello_b', 'hello_c')
       ];
       
       return m.test(function(val) {
         return f.map(val.f)(val.data);
       }, input, output, f.listEqual);
     };
     
     var mx = J3D.Matrix;
     var testAddVec3 = function() {
       var input = [{e1: mx.createVec3(1, 3, 5), e2: mx.createVec3(2, 4, 6)}];
       var output = [mx.createVec3(3, 7, 11)]; 
       return m.test(function(val) {
         return mx.addVec3(val.e1, val.e2);
                     
                     }, input, output, f.listEqual);
     };
     
     return {
       testFoldr: testFoldr,
       testMap: testMap,
       testFilter: function() {
         var input = [{
             f: function(x) { return x < 3; }, 
             e: f.list(1, 5, 2, 8, 0, 10)}];
         var output = [f.list(1, 2, 0)];
         return m.test(function(val) {
           return f.filter(val.f)(val.e);
         }, input, output, f.listEqual);
       },
       
       testAddVec3: testAddVec3,
       testMultiplyVec3: function() {  
         var input = [{e1: mx.createVec3(1, 3, 5), e2: mx.createVec3(2, 4, 6)}];
         var output = [mx.createVec3(2, 12, 30)];
         return m.test(function(val) {
           return mx.multiplyVec3(val.e1, val.e2);
         }, input, output, f.listEqual);
       },
       
       testAbsoluteVec3: function() {
         var input = [{e: mx.createVec3(3, 4, 0)}, {e: mx.createVec3(2, 5, 7)}];
         var output = [5, 8];
         return m.test(function(val) {
           return mx.absoluteVec3(val.e);
         }, input, output, function(a, b) {
           return Math.floor(a) == b;
         });
       },
       testNormalizeVec3: function() {
         var input = [];
         var output = [];
         return m.test(function(val) {
         }, input, output, f.listEqual);
       },
       
       testEqualMat4: function() {
         var input = [{e1: mx.createMat4(
           1, 2, 3, 4,
           5, 6, 7, 8,
           9, 10, 11, 12,
           13, 14, 15, 16
         ), e2: mx.createMat4(
           1, 2, 3, 4,
           5, 6, 7, 8,
           9, 10, 11, 12,
           13, 14, 15, 16
         )}];
         var output = [true];
         return m.test(function(val) {
           return mx.equalMatrix(val.e1, val.e2);
         }, input, output);
       },
       
       testTransposeMat4: function() {
         var input = [{e: mx.createMat4( 
           1, 2, 3, 4,
           5, 6, 7, 8,
           9, 10, 11, 12,
           13, 14, 15, 16
         )}];
         var output = [mx.createMat4(
           1, 5, 9, 13,
           2, 6, 10, 14,
           3, 7, 11, 15,
           4, 8, 12, 16
         )];
         return m.test(function(val) {
           return mx.transposeMat4(val.e);
         }, input, output, mx.equalMatrix);
       },
       
       testMultiplyMat4: function() {
         var input = [{e1: mx.createMat4( 
           1, 2, 3, 4,
           5, 6, 7, 8,
           9, 10, 11, 12,
           13, 14, 15, 16
         ), e2: mx.createMat4(
           1, 2, 3, 4,
           5, 6, 7, 8,
           9, 10, 11, 12,
           13, 14, 15, 16
         )}];
         var output = [mx.createMat4(
           90, 100, 110, 120,
           202, 228, 254, 280,
           314, 356, 398, 440,
           426, 484, 542, 600
         )];
         return m.test(function(val) {
           return mx.multiplyMat4(val.e1, val.e2);
         }, input, output, mx.equalMatrix);
       }
     };
   })();
